<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改')"/>
</head>
<body>
<form class="layui-form" action=""  th:object="${Ymjz}">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
		
						<div class="layui-form-item layui-hide">
		                    <label class="layui-form-label">序号</label>
		                    <div class="layui-input-block">
		                        <input type="text" th:value="*{id}" name="id" lay-verify="title"
		                               autocomplete="off" class="layui-input">
		                    </div>
		                </div>
						
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">部门</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{bm}" type="text" name="bm" autocomplete="off" placeholder="部门" class="layui-input">
		                    </div>
		                </div>
					                
											
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">下级部门</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{xjbm}" type="text" name="xjbm" autocomplete="off" placeholder="下级部门" class="layui-input">
		                    </div>
		                </div>
					                
											
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">姓名</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{xm}" type="text" name="xm" autocomplete="off" placeholder="姓名" class="layui-input">
		                    </div>
		                </div>
					                
											
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">性别</label>
		                    <div class="layui-input-block">
                                <select name="xb" th:field="*{xb}">
                                    <option value="男">男</option>
                                    <option value="女">女</option>
                                </select>
                            </div>
		                </div>
											
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">民族</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{mz}" type="text" name="mz" autocomplete="off" placeholder="民族" class="layui-input">
		                    </div>
		                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">出生日期</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input datetime-input" name="csrq"
                               placeholder="出生日期" th:value="*{csrq}" type="text">
                    </div>
                </div>

											
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">政治面貌</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{zzmm}" type="text" name="zzmm" autocomplete="off" placeholder="政治面貌" class="layui-input">
		                    </div>
		                </div>
					                
											
										
						<div class="layui-form-item">
		                    <label class="layui-form-label">身份证号码</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{sfzhm}" type="text" name="sfzhm" autocomplete="off" placeholder="身份证号码" class="layui-input">
		                    </div>
		                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">参加工作时间</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input datetime-input" name="cjgzsj"
                               placeholder="参加工作时间" th:value="*{cjgzsj}" type="text">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">职务</label>
                    <div class="layui-input-block">
                        <input th:value="*{zw}" type="text" name="zw" autocomplete="off" placeholder="职务"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-block">
                        <input th:value="*{lxdh}" type="text" name="lxdh" autocomplete="off" placeholder="联系电话"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">家庭住址</label>
                    <div class="layui-input-block">
                        <input th:value="*{jtzz}" type="text" name="jtzz" autocomplete="off" placeholder="家庭住址"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">第一次接种时间</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input datetime-input" name="jzsj1" placeholder="第一次接种时间"
                               th:value="${Ymjz.dateToStringConvert(Ymjz.jzsj1)}" type="text">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">第一次接种地点</label>
                    <div class="layui-input-block">
                        <input th:value="*{jzdd1}" type="text" name="jzdd1" autocomplete="off" placeholder="第一次接种地点"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">第二次接种时间</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input datetime-input" name="jzsj2" placeholder="第二次接种时间"
                               th:value="${Ymjz.dateToStringConvert(Ymjz.jzsj2)}" type="text">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">第二次接种地点</label>
                    <div class="layui-input-block">
                        <input th:value="*{jzdd2}" type="text" name="jzdd2" autocomplete="off" placeholder="第二次接种地点"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">第三次接种时间</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input datetime-input" name="jzsj3" placeholder="第三次接种时间"
                               th:value="${Ymjz.dateToStringConvert(Ymjz.jzsj3)}" type="text">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">第三次接种地点</label>
                    <div class="layui-input-block">
                        <input th:value="*{jzdd3}" type="text" name="jzdd3" autocomplete="off" placeholder="第三次接种地点"
                               class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">未接种原因</label>
		                    <div class="layui-input-block">
		                        <input th:value="*{wjzyy}" type="text" name="wjzyy" autocomplete="off" placeholder="未接种原因" class="layui-input">
		                    </div>
		                </div>

            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit=""
                    lay-filter="ymjz-update">
                <i class="layui-icon layui-icon-ok"></i>
				提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
				重置
            </button>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>
<script>
    layui.use(['form','laydate','jquery'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        let MODULE_PATH = rootPath+"/YmjzController";
				var laydate = layui.laydate;
        //同时绑定多个
        lay('.datetime-input').each(function(){
          laydate.render({
            elem: this
            ,trigger: 'click'
            ,type: 'datetime'
          });
        });


        form.on('submit(ymjz-update)', function (data) {
        	let loader = layer.load();
            $.ajax({
                url: MODULE_PATH+'/edit',
                data: data.field,
                dataType: 'json',
                contentType: 'application/x-www-form-urlencoded',
                type: 'post',
                success: function (result) {
                    if (result.code==200) {
                        layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                            parent.layui.table.reload("ymjz-table");
                            layer.close(loader);
                        });
                    } else {
                        layer.msg(result.msg, {icon: 2, time: 1000});
                        layer.close(loader);
                    }
                }
            })
            return false;
        });
    })
</script>
</body>
</html>